After deployment of the build artifacts, we must be able to reproduce for each artifact from which sources (changelistnumber and perforce server) the artifact was built. During the build, we provide a file named <artifactId>-<version>-versions.xml with each artifact. As a prerequisite, a file named sync.info in the root folder of the project must exist. The sync.info file has the following syntax:
depotpath=MY_DEPOT_PATH/... port=MY_PERFORCE_PORT changelist=CHANGELIST_NUMBER
The versions.xml generated during the build has the following syntax:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <versions> <coordinates> <groupId>GROUP_ID</groupId> <artifactId>ARTIFACT_ID</artifactId> <version>VERSION</version> </coordinates> <scm> <connection>scm:perforce:MY_PERFORCE_PORT://MY_DEPOT_PATH/</connection> <revision>CHANGELIST_NUMBER</revision> </scm> </versions>
The versions.xml is enhanced to contain also information for all dependent projects.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <versions> <coordinates> <groupId>GROUP_ID</groupId> <artifactId>ARTIFACT_ID</artifactId> <version>VERSION</version> </coordinates> <scm> <connection>scm:perforce:MY_PERFORCE_PORT://MY_DEPOT_PATH/</connection> <revision>CHANGELIST_NUMBER</revision> </scm> <dependencies> <dependency> <coordinates> <groupId>GROUP_ID_PREDESSESOR_PROJECT</groupId> <artifactId>ARTIFACT_ID_PREDESSESOR_PROJECT</artifactId> <version>VERSION_PREDESSESOR_PROJECT</version> </coordinates> <scm> <connection>scm:perforce:MY_PERFORCE_PORT://MY_DEPOT_PATH/</connection> <revision>CHANGELIST_NUMBER</revision> </scm> </dependency> ..... </dependencies> </versions>